
package com.wyzz.hr.action;

import java.util.ArrayList;
import java.util.List;

import com.wyzz.hr.base.BaseAction;
import com.wyzz.hr.bo.IPositionBo;
import com.wyzz.hr.pojo.Position;
import com.wyzz.hr.spring.SpringBeanFactory;

public class DWRForChooseOrgDiv extends BaseAction {

	public DWRForChooseOrgDiv() {
	}

	public List getPositionTreeList() {
		IPositionBo positionBo = (IPositionBo) SpringBeanFactory
				.getBean("positionBo");
		List nodeList = new ArrayList();
		nodeList = positionBo.getPositionTreeListNode();
		return nodeList;
	}

	public List changeSupPos(String posId) {
		IPositionBo positionBo = (IPositionBo) SpringBeanFactory
				.getBean("positionBo");
		Position pos = positionBo.getPosById(posId,
				new String[] { Position.PROP_POSITION_PB_ID });
		List nodeList = new ArrayList();
		if (pos.getPositionPbId().getPbInCharge().intValue() == 0)
			nodeList = positionBo.getChangeSupTreeListNode(posId);
		else if (pos.getPositionPbId().getPbInCharge().intValue() == 1)
			nodeList = positionBo.generateEmpConnTreeNodes();
		return nodeList;
	}

	private static final long serialVersionUID = 1L;
}
